<!--  -->
<template>
<div class='syxelement' v-for="(item, index) in data.list" :key="item.articlenumber">
  <div class="syxelement-user">
    <div>
      <img src="https://ftp.bmp.ovh/imgs/2021/02/635c26d0169cc1ec.png" alt="" class="titleimg">
      <span class="sort">java# html#</span>
    </div>
    <div class="functionioc">
      <i :class="{
        iconfont: true,
        icondianzan_huaban1: true,
        ioc: true,
        }"></i>
        <i :class="{
        iconfont: true,
        iconforward: true,
        ioc: true
        }"></i>
        <i :class="{
        iconfont: true,
        iconshoucang2: true,
        ioc: true
        }"></i>
        <i @click="addattention(item.articlenumber, index)" :class="[item.articlenumber === data.num[index]?ioc2:ioc, 'el-icon-plus']"></i>
    </div>
    <div class="data">{{ item.articletime }}</div>
  </div>
  <div class="composition">
    <h3>{{ item.articlename }}</h3>
    <p>{{ item.articlebody }}</p>
  </div>
  <div class="compimglist">
    <el-image
      style="width: 250px; height: 200px"
      :src="'https://ftp.bmp.ovh/imgs/2021/02/635c26d0169cc1ec.png'"
      :preview-src-list="srcList"
      class="compimg">
    </el-image>
    <el-image
      style="width: 250px; height: 200px"
      :src="'https://ftp.bmp.ovh/imgs/2021/02/635c26d0169cc1ec.png'"
      :preview-src-list="srcList"
      class="compimg">
    </el-image>
    <el-image
      style="width: 250px; height: 200px;"
      :src="'https://ftp.bmp.ovh/imgs/2021/02/635c26d0169cc1ec.png'"
      :preview-src-list="srcList"
      class="compimg">
    </el-image>
  </div>
</div>
</template>

<script lang='ts'>

import { defineComponent, onMounted } from 'vue'
import getRecommendFun from '@/use/recommend/syxelement.ts'

export default defineComponent({
  name: '',
  props: {
    msg: String
  },

  setup () {
    // 变量
    const {
      data
    } = getRecommendFun()
    console.log(data.isbtns)
    // 方法
    const {
      requestArt,
      addattention
    } = getRecommendFun()
    onMounted(() => {
      requestArt()
    })
    return {
      srcList: [
        'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
        'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
      ],
      data,
      addattention,
      ioc: 'ioc',
      ioc2: 'ioc2'
    }
  }
})
</script>

<style scoped lang='scss'>
.ioccolor{
  color: skyblue;
}
.ioc{
  font-size: 25px;
}
.ioc2{
  font-size: 25px;
  color: red;
}
p{
  text-indent: 2rem;
  line-height: 1.8rem;
  white-space:nowrap;
  letter-spacing:0.1rem;
  overflow-x: hidden;
  text-overflow:ellipsis;
  font-family: 华文行楷;
  font-size: 18px;
}
.titleimg{
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
.syxelement{
  margin-top:30px ;
  padding: 15px;
  width: 990px;
  height: 400px;
  box-shadow: 0px 1px 18px rgba(90, 90, 90,.2);
  border-radius: 30px;
  border: 1px solid rgba(90, 90, 90,.1);
}
.syxelement-user{
  position: relative;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(90, 90, 90,.2);
  padding: 5px 0px;
}
.data{
  color: rgba(90, 90, 90,.6);
  font-size: 10px;
}
.sort{
  color: rgba(90, 90, 90,.6);
  font-size: 10px;
  margin-left: 10px;
}
.compimglist{
  height: 300px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .compimg{
    border-radius: 15px;
  }
}
.functionioc{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  i{
    margin: 0px 10px;
    cursor: pointer;
  }
}
</style>
